package com.airforce.utils;

import lombok.Data;

import java.io.Serializable;


public enum ResultCode implements Serializable{
    /** 成功 */  
    SUCCESS(200, "成功"),
    SUCCESS_By_info(200, "人物数据整合成功"),
    /** 没有登录 */  
    NOT_LOGIN(400, "没有登录"),

    /** 发生异常 */
    EXCEPTION(401, "发生异常"),

    TOKEN_ERROR(402,"Token失效,请重新登录"),

    SIGN_ERROR(403,"签名错误"),

    NO_SIGN(405,"缺少签名参数"),
    NO_bh(406,"编号不存在或已被使用"),
    Error_zone_tel(406,"数据电话或地区信息不完整"),
    Error_ztableman(406,"登记人信息更新出错"),
    NO_TOKEN(406,"缺少Token参数"),
    KEY_USER(407,"用户已存在"),
    NO_USER( 408,"用户不存在"),
    DELETEDEBT_ERROR(409,"用户删除失败"),
    /** 不支持或已经废弃 */  
    NOT_SUPPORTED(410, "不支持或已经废弃"),

    NO_USERPWD(411,"用户名或密码错误"),

    /** 登陆失败 */
    Fail_LOGIN(412, "登陆失败"),


    Empty_Selct(444,"查询结果为空"),
    Add_file_fail(444,"文件添加失败"),
    /**无权*/
    PERMISSION_DENIED(413,"无权限"),
    No_PERMISSION_Add_Excel(413,"无权限添加其他地区的数据"),
    NOFULLINFO(413,"Excrel表格内联系方式不完整"),
    DEBTID_NOEXIT(414,"债务ID不存在"),

    LOGINOUT(415,"退出登入"),
    NO_ZONE(416,"地区不存在"),
    NO_PARM(417,"参数不能为空"),
    JWT_ERROR(418,"JWT错误"),
    FILE_ERROR(419,"文件异常"),
    ERRPR_PHONE(420,"手机号位数异常"),
    NO_CHECK(421,"请查询后再操作"),
    NO_ADD(423,"分享成功"),
    NO_LOOTNUM(424,"抽奖次数不足"),
    FAIL_PASSWORD(425,"旧密码错误,请输入正确密码"),
    /** AuthCode错误 */
    INcodeID_AUTHCODE(444, "无效的AuthCode"),
  
    /** 太频繁的调用 */  
    TOO_FREQUENT(445, "太频繁的调用"),

      
    /** 未知的错误 */  
    UNKNOWN_ERROR(499, "未知错误"),

    IP_LIMIT(511,"IP受限");



     ResultCode(int codeue, String msg){
        this.code = codeue;
        this.msg = msg;

    }




    public int code() {
        return code;  
    }  
  
    public String msg() {  
        return msg;  
    }

//    public Object data(SelectCloserLoopBean sclb) {
//        return data;
//    }

    public void setdata(Object data) {
        this.data=data;
    }

    private int code;

    private String msg;

    private Object data=null;

    public Object result() {
        result res=new result();
        res.setMsg(this.msg);
        res.setCode(this.code);
        return res;

    }

    public Object result(Object data) {
        result res=new result();
        res.setData(data);
        res.setMsg(this.msg);
        res.setCode(this.code);
        return res;

    }
    public Object result(Object data,Object num) {
        result res=new result();
        res.setData(data);
        res.setMsg(this.msg);
        res.setCode(this.code);
        res.setMaxPage(num);
        return res;

    }
    public Object result(Object data,Object num,Object zone) {
        result res=new result();
        res.setData(data);
        res.setMsg(this.msg);
        res.setCode(this.code);
        res.setMaxPage(num);
        res.setZone(zone);
        return res;

    }


    @Data
    class result
    {

        private int code;

        private String msg;

        private Object data=null;

        private Object MaxPage;

        private Object zone;
    }



}  